<?php

	function startSession()
	{
		if ( empty( $_SESSION['email'] ) )
		{
			session_start();
		}
	}

	function destroySession()
	{
		if( !empty( $_SESSION['email'] ) )
		{
			unset( $_SESSION['email'] );
			unset( $_SESSION['firstName'] );
			unset( $_SESSION['lastName'] );
			session_destroy(); 
		}
	}
	
	function checkSession()
	{
		if ( empty( $_SESSION['email'] ) )
		{	
			header ( "Location: login.php" );
		}
	}
	
	function checkLog()
	{
		if ( empty( $_SESSION['email'] ) )
		{	
			return "Login";
		}
		else
		{
			return "Logout";
		}
	}

?>